package mud;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlIDREF;

/** A one-way connection from one room to another */
public class Exit {

    /** the id of the exit */
    @SuppressWarnings("unused")
    @XmlAttribute
    @XmlID
    private String id;
    
    /** the name of the exit */
    @XmlAttribute
    private String name;
    
    /** the room which contains this exit */
    @XmlAttribute
    @XmlIDREF
    private Room room;

    /** the exit to which this exit leads */
    @XmlAttribute
    @XmlIDREF
    private Exit peer;
    
    /**
     * @return the name of the exit
     */
    public String getName() {
        return name;
    }

    /**
     * @return the room which contains this exit
     */
    public Room getRoom() {
        return room;
    }

    /**
     * @return the exit to which this exit leads
     */
    public Exit getPeer() {
        return peer;
    }
}
